package disjunction.collections
{
	/**
	 * @author Nick Wiggill
	 */
	
	public class Iterator
	{
        private var _collection:CollectionReadOnly;
        private var _cursor:int;

		public function Iterator(collection:CollectionReadOnly)
		{
			_collection = collection;
			_cursor = 0;
		}
		
		public function hasNext():Boolean
		{
			return this._cursor < this._collection.getLength();
		}
		
		public function next():Object
		{
			return (this._collection.getItemAt(this._cursor++));
		}
	}
}